//
//  AboutUsController.m
//  Food
//
//  Created by dlios on 15/7/27.
//  Copyright (c) 2015年 李志远. All rights reserved.
//

#import "AboutUsController.h"

@interface AboutUsController ()
@property (nonatomic, retain) UIScrollView *scrollView;

@end

@implementation AboutUsController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.title = @"关于我们";
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationController.navigationBar.translucent = NO;

    self.scrollView = [[[UIScrollView alloc] initWithFrame:self.view.frame] autorelease];
    self.scrollView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"backGround"]];
    [self.view addSubview:_scrollView];

    UIImageView *myImage = [[UIImageView alloc] initWithFrame:CGRectMake(self.view.frame.size.width / 2 - 30, 20, 60, 60)];
    myImage.image = [UIImage imageNamed:@"logo"];
    [self.scrollView addSubview:myImage];
    [myImage release];

    UILabel *label = [[[UILabel alloc] initWithFrame:CGRectMake(20, 80, self.view.frame.size.width - 40, self.view.frame.size.height - 64)] autorelease];
    label.text = @"   版本功能:\n\n   各种美食的做法在这里都可学到\n   教你健康养生\n   寻找附近美食.\n\n\n   版本更新:\n\n   1.添加更多菜谱.\n   2.优化内存,程序运行更流畅.\n   3.修复部分bug.\n\n\n   关于我们:\n\n   团队成员:孙俊夫、肖尚园、李志远\n\n   感谢您使用我们的软件";
    label.numberOfLines = 0;
    label.font = [UIFont systemFontOfSize:18];
    [self.scrollView addSubview:label];
    
    NSString *str = label.text;
    NSDictionary *dic = @{NSFontAttributeName: [UIFont systemFontOfSize:18]};
    CGRect rect = [str boundingRectWithSize:CGSizeMake(self.view.frame.size.width - 40, 10000) options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil ];
    
    self.scrollView.contentSize = CGSizeMake(0, 200 + rect.size.height);

    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
